<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <table>
      <tr v-for="(blog,key,index) in blogs" :key="index">
        <td>{{ blog.id }}</td>
        <td>{{ blog.title }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
// @ is an alias to /src
import { httpGet,httpPost } from "@/axios/http";

export default {
  name: 'home',
  data() {
    return {
        blogs:[
          {id:1,title:'aaa'},
          {id:2,title:'bbb'}
        ]
        
    }
  },
  mounted(){
    this.blogList()
  },
  methods:{
    blogList(){
      httpGet('/blog/getBlogList')
        .then(res => {
          this.blogs = res
      }).catch(error => {
        console.log('error:')
        console.log(error)
      })
      }
    }
}
</script>
